package longshu.srpc.api;

import java.io.Serializable;
import java.util.Arrays;

/**
 * RpcRequest
 *
 * @author LongShu 2017/12/03
 */
public class RpcRequest implements Serializable {
    private static final long serialVersionUID = 1L;

    private String requestId;
    private String serviceName;
    private String methodName;

    private Class<?>[] parameterTypes;
    private Object[] parameters;

    public String getRequestId() {
        return requestId;
    }

    public RpcRequest setRequestId(String requestId) {
        this.requestId = requestId;
        return this;
    }

    public String getServiceName() {
        return serviceName;
    }

    public RpcRequest setServiceName(String serviceName) {
        this.serviceName = serviceName;
        return this;
    }

    public String getMethodName() {
        return methodName;
    }

    public RpcRequest setMethodName(String methodName) {
        this.methodName = methodName;
        return this;
    }

    public Class<?>[] getParameterTypes() {
        return parameterTypes;
    }

    public RpcRequest setParameterTypes(Class<?>[] parameterTypes) {
        this.parameterTypes = parameterTypes;
        return this;
    }

    public Object[] getParameters() {
        return parameters;
    }

    public RpcRequest setParameters(Object[] parameters) {
        this.parameters = parameters;
        return this;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("RpcRequest{");
        sb.append("requestId='").append(requestId).append('\'').append("\n");
        sb.append(", serviceName='").append(serviceName).append('\'');
        sb.append(", methodName='").append(methodName).append('\'').append("\n");
        sb.append(", parameterTypes=").append(Arrays.toString(parameterTypes));
        sb.append(", parameters=").append(Arrays.toString(parameters)).append("\n");
        sb.append('}');
        return sb.toString();
    }

}
